package com.yyy.dm.consumer.controller;

import com.yyy.dm.CommonResponse;
import com.yyy.dm.consumer.service.ItemTypeConsumerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.Map;

@RestController
@RequestMapping("/item")
public class ItemTypeConsumerController {

    @Resource
    ItemTypeConsumerService itemTypeConsumerService;
    //首页类别
    @PostMapping("/index/nav")
    public CommonResponse findIndexNav() throws IOException {
        return itemTypeConsumerService.nav();
    }
    //首页横类别
    @PostMapping("/index/lineNav")
    public CommonResponse lineNav(){
        return itemTypeConsumerService.lineNav();
    }
    //首页楼层d
    @PostMapping("/index/floor")
    public CommonResponse floor(){
        return itemTypeConsumerService.floor();
    }
    //商品详情热门推荐
    @PostMapping("/desc/getRecommend")
    public CommonResponse getRecommend(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.getRecommend(map.get("itemTypeId"));
    }
    //查询页面商品类别
    @PostMapping("/list/sortgoods")
    public CommonResponse sortGoods(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.sortGoods(map.get("parent"));
    }
    //亲子页面轮播图
    @PostMapping("/multiple/getCarouselData")
    public CommonResponse getCarouselData(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.getCarouselData(map.get("itemTypeId"));
    }
    //亲子猜你喜欢
    @PostMapping("/multiple/getGuessYouLike")
    public CommonResponse getGuessYouLike(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.getGuessYouLike(map.get("itemTypeId"));
    }

    //亲子精彩聚焦
    @PostMapping("/multiple/getWonderfulData")
    public CommonResponse getWonderfulData(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.getWonderfulData(map.get("itemTypeId"));
    }
    //亲子根据年龄段查询
    @PostMapping("/multiple/getParentChild")
    public CommonResponse getParentChild(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.getParentChild(map.get("ageGroup"),map.get("limit"));
    }
    //亲子热门排行榜
    @PostMapping("/multiple/getPopularSearch")
    public CommonResponse getPopularSearch(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.getPopularSearch(map.get("itemTypeId"));
    }
    //亲子页面广告地址及信息页面
    @PostMapping("/multiple/getAdimgUrl")
    public CommonResponse getAdimgUrl(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.getAdimgUrl(map.get("itemTypeId"));
    }
    //亲子月份查询演出
    @PostMapping("/multiple/getCalendarData")
    public CommonResponse getCalendarData(@RequestBody Map<String,Long> map){
        return itemTypeConsumerService.getCalendarData(map.get("itemTypeId"));
    }

}
